QReadWriteLock: fix data race on weakly-ordered memory architectures
authorDebian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Wed, 31 Dec 2025 10:28:57 +0000 (13:28 +0300)
committerDmitry Shachnev <mitya57@debian.org>
Wed, 31 Dec 2025 10:28:57 +0000 (13:28 +0300)
commitc856a00e75a918b1eb6530adb23011bfb4f8f5fc
tree3224c6afc54f6303b9f155100af2909551026d09
parentea0dc295685f416f54b920dceb1016b550b34473
QReadWriteLock: fix data race on weakly-ordered memory architectures

Origin: upstream, https://code.qt.io/cgit/qt/qtbase.git/commit?id=4fd88011fa7975ce
Last-Update: 2025-12-14

The fix changes the relaxed load of d_ptr in lockFor{Read,Write} after
the acquire of the mutex to an acquire load, to establish
synchronization with the release store of d_ptr when converting from an
uncontended lock to a contended lock.

Gbp-Pq: Name qreadwritelock_data_race_2.diff
src/corelib/thread/qreadwritelock.cpp
tests/auto/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp